<?php
class Optionmodel extends CI_Model{
	function getPosOption(){
		$query = $this->db->get('pos_option');
		return $query->result_array();
	}
	
	function getVendorTypeOption(){
		$query = $this->db->get('type_option');
		return $query->result_array();
	}
	
	function getVillageOption(){
		$query = $this->db->get('option_village');
		return $query->result_array();
	}
	
	function getExistVillageOption(){
		// village that have transaction
		$this->db->select('option_village.villageid as villageid,villagename',FALSE);
		$this->db->from('truck_group_pay');
		$this->db->join('option_village','truck_group_pay.villageid = option_village.villageid');
		$this->db->order_by('villageid asc');
		return $this->db->get()->result_array();
	}
}